package com.cow.framework.core.exception;
/**
 * 业务提示
 * 
 * @author yangsj 
 */
public class BusinessHint extends RuntimeException
 {
   private static final long serialVersionUID = 5808616192752024016L;
   private String code;
   private Object[] args;
 
   public BusinessHint()
   {
   }
   
   public BusinessHint(String code, String msg)
   {
     super(msg);
     this.code = code;
   }

   public BusinessHint(String code, String msg, Object[] _args)
   {
     super(msg);
     this.code = code;
     this.args = _args;
   }

   public BusinessHint(Throwable exception)
   {
     super(exception);
     getExceptionCode(exception);
   }
 
   private void getExceptionCode(Throwable exception)
   {
     if ((exception instanceof BusinessHint))
     {
       this.code = ((BusinessHint)exception).getCode();
     }
     else
     {
       this.code = "999999";
     }
   }
 
   public String getCode() {
     return this.code;
   }
 
   public void setCode(String code) {
     this.code = code;
   }
 
   public Object[] getArgs() {
     return this.args;
   }
 
   public void setArgs(Object[] args) {
     this.args = args;
   }
 }
